import { defHttp } from "@/utils/http";

// ERP 中标补充 VO
export interface BidResultSupplVO {
	id: number; // 主键
	contractId: number; // 合同ID
	sqNumb: number; // 序号
	biddingDate: Date; // 日期
	drugId: number; // 药品编码
	qty: number; // 数量
	notes: string; // 备注
}

// ERP 中标补充 API
export const BidResultSupplApi = {
	// 查询中标补充分页
	getBidResultSupplPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/bidding-result-suppl/page`, params });
	},

	// 查询中标补充详情
	getBidResultSuppl: async (id: number) => {
		return await defHttp.get({ url: `/whs/bidding-result-suppl/get?id=` + id });
	},

	// 新增中标补充
	createBidResultSuppl: async (data: BidResultSupplVO) => {
		return await defHttp.post({ url: `/whs/bidding-result-suppl/create`, data });
	},

	// 修改中标补充
	updateBidResultSuppl: async (data: BidResultSupplVO) => {
		return await defHttp.put({ url: `/whs/bidding-result-suppl/update`, data });
	},

	// 删除中标补充
	deleteBidResultSuppl: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/bidding-result-suppl/delete?id=` + id
		});
	},

	// 导出中标补充 Excel
	exportBidResultSuppl: async (params: any) => {
		return await defHttp.download({ url: `/whs/bidding-result-suppl/export-excel`, params });
	}
};
